using System;
using System.Data;
using System.Data.SqlClient;
using System.Data.SqlTypes;
using Microsoft.SqlServer.Server;
using System.Threading;

public partial class StoredProcedures {
  [Microsoft.SqlServer.Server.SqlProcedure]
  public static SqlInt32 WSDB_NOTIFY(SqlString schema) {
    string evscehmaname = @"Global\F60DFD38-7876-429A-8990-6462183AB8F4_" + schema.ToString();
    EventWaitHandle evschema = null;
    bool be = EventWaitHandle.TryOpenExisting(evscehmaname, out evschema);
    if (be == false) { return -1; }
    if (evschema == null) { return -1; }

    evschema.Set();

    evschema.Close(); evschema.Dispose(); evschema = null;

    return 1;
  }
}
